improve typeof usage
Merge pull request #113 from Daniel-Hug/patch-5

improve typeof usage