Patches ENV variable bugs