Reworked the level on which the cache lock is held.
Some tweaks to the serialisation.