fixes to handle NaNs