Fix z when using non-interactive shell