Fix bug with return between sci_undo*

return between sci_undo transaction will break undos completely