small fixes in some queries...