Dealing with corrupt preference files on OS X

Due to running out of disk space, plus a forced shutdown, I ended up with a corrupted keychain and quite a few corrupted plist preference files in OS X; the applications would mostly delete them and create new ones, but it was causing problems. Luckily I had recent backups, while a couple of useful applications came to the rescue for making sure everything was fixed: