Fixing broken transaction handling