Transaction fixes.

Uncrustify.
Merged from trunk.
merge from lp:~peter-simpson/openpetraorg/dev_20140904_null_DB_transaction_fixes