Improve initial value setting logic.