fix $HOME bug in fnamemodify()