Fix weird bug with new numpy version.
Comparisions with np.nan and numpy ndarrays dont work as intended in the current version. This hotfix should be backwards compatible and while less clean give the same results
Comparisions with np.nan and numpy ndarrays dont work as intended in the current version. This hotfix should be backwards compatible and while less clean give the same results