Fixed an iussue where ~/ expanded into the wrong directory structure