Minor bugfixes for pwhat and cd scripts