Fix environment detecting error.