 	}
 
 	public func indexPath(fromFlattened index: Int) -> IndexPath {
+		let index = index - numberOfPrependedRows
+
+		if index < 0 {
+			// Prepended rows
+			return IndexPath(row: numberOfPrependedRows - abs(index), section: -1)
+		}
+
 		for (sectionIndex, range) in flattenedRanges.enumerated() {
 			if !config.hidesSectionHeader && range.lowerBound == index {
 				return IndexPath(section: sectionIndex)

}

final public class NSTableViewAdapter<ViewModel, Provider: NSTableViewAdapterProvider>: NSObject, NSTableViewDataSource {
	private let set: ViewModelCollection<ViewModel>
	private unowned let provider: Provider
	private let config: NSTableViewAdapterConfig
	private var flattenedRanges: [Range<Int>] = []

	private var offset: Int {
		return config.hidesSectionHeader ? 0 : 1

	}

	private func flattenedIndex(fromSectioned index: IndexPath, for ranges: [Range<Int>]) -> Int {
		return ranges[index.section].lowerBound + index.row + offset + numberOfPrependedRows
	}

	public func hasGroupRow(at index: Int) -> Bool {
		let index = index - numberOfPrependedRows
		return !config.hidesSectionHeader && flattenedRanges.contains { $0.lowerBound == index }
	}

	public func numberOfRows(in tableView: NSTableView) -> Int {
		return (config.hidesSectionHeader ? 0 : set.sectionCount)
			+ (0 ..< set.sectionCount).reduce(0) { $0 + set.rowCount(for: $1) }
		  + numberOfPrependedRows
	}

	public func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
