Rollback callbacks weren't being properly called, and some other things were in the wrong place, particularly with nested transactions.