Fixing transaction management (yet again) and previously failing tests.