Add unit test for SnapshotPeeker, fix bugs found by unit test