some fixes to make the code work with MSVC
fixed file permissions