Handle $HOME and other environment variables in paths