Fix ocasionally unscoped query