Fixed a bug that caused the most recent record to be ignored when trying to remove it from the local cache.