Fixed queries and naming inconsistencies