Compatibility with windows

Minor adjustments to the code in order to make it compile and also on windows platforms.