BugFix: wrong usage of undefined with typeof