fix missing error output, and resolving destination file when compiling to ./