Add possibility to specify just the directory of the output file (fixes #33)