Fix patched environment variables