Lots of bugfixes found while testing upgrading from 1.0 -> 2.0