Fixes querying with a type