Fix error when only one data point is available (issue #45)