Capture errors from transaction funs and pass them back.
Added delete function.

Style changes.