Fixing implementation of 'typeof'