Fixed possible division by zero in TriangleGenerator.