Fixed bug when invalidating lots of keys at once