Fixed missing typeof

Added missing typeof, and moved typeof evaluation out of the map.
isString makes more easy to read and understand.
Merge pull request #3 from gotik/patch-3

Fixed missing typeof