Fixes and tests for transactions.