fixed some bugs in the CountWiningLines heuristic pattern