         // Connect the line to the ending edge if we are filling it.
         if(shouldFill) {
             // Add a line from the last data point to the base of the graph.
-            let lastDataPoint = graphPoints[activePointsInterval.endIndex]
+            let lastDataPoint = graphPoints[activePointsInterval.endIndex - 1]
             
             let viewportRightZero = CGPoint(x: lastDataPoint.x + (rightmostPointPadding), y: zeroYPosition)
             let rightFarEdgeTop = CGPoint(x: lastDataPoint.x + (rightmostPointPadding + viewportWidth), y: zeroYPosition)

        let actualMin = clamp(min - numberOfPointsOffscreen, min: minPossible, max: maxPossible)
        let actualMax = clamp(max + numberOfPointsOffscreen, min: minPossible, max: maxPossible)
        
        return actualMin ..< actualMax
    }
    
    private func calculateRangeForActivePointsInterval(interval: Range<Int>) -> (min: Double, max: Double) {
        
        let dataForActivePoints = data[interval.startIndex...interval.endIndex]
        
        // We don't have any active points, return defaults.
        if(dataForActivePoints.count == 0) {

                return barPath
        }
        
        for i in activePointsInterval {
            
            var location = CGPointZero
            
