Fixes for transaction handling