Rejecting both segmentation and classication errors in handwritten form processing