Fix scope of context queries

fixes #30