Fixed query

Closes #2.