Improved transaction error handling.