Fix for floating point comparisons with NaN and Infinity.
Added foreign scalar tests