Fixed queries to get resources.