Using atomic transactions now. Fixed #32