Added safer path handling for Windows

This partially solves #150