Windows Bugfixes Final

Final working fix for NODE_ENV bug on windows.