Added 'fix' command, added -m, -r, -f options, and improved tests.