Feature #1607: Code cleanup, add total column to tables