Fixed behavior of entity cache.