Do special argument check for NaN values

First PR, fixes the NaN check error :smile: