Fixed issue where outputting to a file left a zero-byte file in pwd.