Return value fixes for various queries