Fix query. Fixes #2