Use a better test for type