Fixed a bug in the zone out algorithm.