Fixing a f'ing typeof bug