[Fix] Fixing previous incorrect removal of using typeof

- When checking a value to not be "undefined", should be using `typeof` which I previously was but incorrectly removed when doing cleanup/optimizations
Merge pull request #77 from stulees/bug/check-undefined

[Fix] Fixing previous incorrect removal of using typeof