Originally `z foo` printed a blank line after the command. My recent
change accidentally changed how CMD interpreted the end of the file such
that CMD stopped printing the blank line. This change adjusts the end
of the file to once again cause CMD to print a blank line on finish.
`z somedir` uses double `pushd` to tunnel the new path out past the
endlocal that restores the environment state. But it ended up leaving
a pushd on the dir stack.
This change exploits normal variable expansion to restore the dir stack
to its initial state while still successfully tunneling the new path out
past the endlocal.