more queries and small fixes: