Improve QueryRow handling