Bugfix

"er not defined" when commit fails.
"Exception not defined" when locks are not balanced.