Improve $PATH parsing