Changed exception thrown by query() to RuntimeException.