[fix] Do a correct typeof check