Transaction implemented

Minor fixes and improvements