Fix error when using tilde in paths.