Dired fixes, refactoring.