fixed some path-related bugs after testing on Windows [thanks Lorenzo Natale]