Fix ~ in path bug