Fixed erroneous check for typeof

I am not a smart man ...