Implemented snapshots and fix some tests