Fix preapre.sh replacement of env vars