Updated to be more granular with transactions.

This is for issue #13.