Fix service cache syncing.

Make sure PZP service cache is sync'd correctly, and tidy up code.