Fixing queries
Preparing for merge with master