Fix a couple of bugs and start creating snapshots in the select loop.