Fix error mask generation in checkLineContinuity