Use dirname
Make pushd's silent