Fixed an issue where an output path being specified as a directory was being ignored and the output file would end up in the same directory as the source file.