Fix a number of bugs with take_snapshot

Mock up dependencies of take_snapshot thoroughly