Fixes queries for obtaining relevant purposes.