Local cache locking bugfixes.