Add support for expanding directory which starts by ~/