Fix env vars write