Fix nested transactions issue

- Fix for issue #1