Fixes error with nesting transactions.
Adds initial version of test suite for said error.