Multiple fixes

- Added types conversion
- Fixed exceptions throwing
- Added transaction rollback on error