Debug messages
Fix error for queries