[Minor] caught an NPE when the Transaction fails but no cause is set
[Minor] minor code cleanup