some fixes for querying without parameter