ENH: Deal with NAN inputs and other corner cases.
Merge pull request #343 from aylward/SegmentCC

ENH: Deal with NAN inputs and other corner cases.