Scope selector queries (fixes #634)