Fixed minor bug

Tilde was not dealt with correctly for output directory.