Zero initialize ch to avoid possible bug - conditions are very subtle.