Fix bug: directory arg parsed incorrectly.
Fix bug: working directory not restored on quit