Wrap bootstrapping in a transaction. Closes #316.