Fix Expand for path of len <= 1.

Current implementation panics if `len(path) <= 1`, thus do not produce desired result for single `~` path.