Bug fix when datapoints is None