Fix for truthiness check in type conversions

The truthiness checks on these lines will always be false. 

typeof always returns a string value that is never null and never undefined.