Fixed dired and osx specific behavior.