Fixing of errors due to NANs in interpth.