Add default value for output
Change backward variable naming
Fix potential output path issue on Windows

Thanks to @unconditional for spotting this.