Updated windows only code

Updated windows only code with cross platform code for portability and
other tiny fixes as well. #21