Fix environment corruption that prevents some applications from starting