Atomic updates and tags

Fixes some problems with atomic updates, and fixes #229