Bugfix in code for updating bookkeeping