Fixed dirty tracking for entities returned from `where` and `all`