Fix/Tests for #1218

The PR delivers tests for #1218. It also passes possible errors to the transaction callback, if two arguments are defined in the callback.