Better '~' handling on Windows
Windows fixes