Added cleaning tables from old data (issue #1856)