 // MARK: -
 
 public extension DispatchData {
-    func toBuffer() -> Buffer <Void> {
-        return map() {
+    func toBuffer() -> Buffer <Element> {
+        return createMap() {
             (data, ptr) in
-            return Buffer <Void> (ptr)
+            return Buffer <Element> (ptr)
         }
     }
 }

        self.init(data: dispatch_data_create(start, count * DispatchData <Element>.elementSize, nil, nil))
    }

    // MARK: -

    public func subBuffer(range: Range <Int>) -> DispatchData <Element> {
        assert(range.startIndex >= startIndex && range.startIndex <= endIndex)

        return DispatchData <Element> (data: dispatch_data_create_subrange(data, range.startIndex * elementSize, (range.endIndex - range.startIndex) * elementSize))
    }

    public func subBuffer(startIndex startIndex: Int, count: Int) -> DispatchData <Element> {
        return subBuffer(Range <Int> (start: startIndex, end: startIndex + count))
    }
