Adding transaction management.
Bug fixes
Fixed some bugs