ModelCache: Cache was not invalidated in some cases