Fix bug when lazy-loading entities that otherwise could have been loaded at once