Fixed transaction bugs