Fix query stitching

Oops. Closes #40.