Fixing isNumber to account for NaN; introducing tests for isNumber