Fix a crash when number of graph points is zero