Fix ref before assignment bug.