Fixed bugs in accounting