Fix #519 path expand problem
Improve completion behavior