Fix invalid return when query string is empty