Account for angles near 0 and 2pi.