Fix path handling on windows and osx/linux