Fixed some bugs in the transactions.