Use --debug-file like other tools.
Fix memory leaks reported by Valgrind.