Fix transactions, added inTransaction tests