Repair damaged user files. Fixes #1869