Fix for D2636: Deleted entity should not appear in query results (unless includeDeleted is true)