fixed build directory check for output file. fixes #83
Merge pull request #84 from dynosure/build_dir_fix

Fixe build directory check for output file.

Ref. #83 and #84