Tested and fixed queries