Fixed inheriting a query from the parent.