Fix transaction management.