             return nil;
         }
         
-        return IndexedFileV1(byteOrder: LittleEndian(), binaryFile: result.value, type: type)
+        return IndexedFileV1(byteOrder: LittleEndian(), binaryFile: result.value)
     }
     
-    init(byteOrder: ByteOrder, binaryFile: BinaryFile, type: Type) {
+    init(byteOrder: ByteOrder, binaryFile: BinaryFile) {
         self.byteOrder = byteOrder
         self.binaryFile = binaryFile
         self.mappedBuffer = binaryFile.map(LittleEndian(), mode: .ReadOnly).value
         self.header = IndexedFileV1.readHeader(self.mappedBuffer)
 
-        if (self.header.pageSize != type.toRaw()) {
+        if (self.header.pageSize != 1024 && self.header.pageSize != 256) {
             fatalError("Invalid file: Unexpected page size")
         }
     }

        return buffer.getIndexedFileV1Header()
    }

    struct Header { // 1024
        var fileType: UInt32 = 0
        var pageSize: Int = 0
        var fileSize: Int = 0

    }
}

public class IndexedFileV1 {
    var byteOrder: ByteOrder
    var binaryFile: BinaryFile
    var header: Header
    var mappedBuffer: ByteBuffer
    var indexCache = Dictionary<Int, Index>(minimumCapacity: 64)
    
    public var readonlyHeader: Header {
        return header
    }
    
    public struct Error {
        public let code: Int
        public let message: String
        
        public init(code: Int = 0, message: String = "") {
            self.code = code
            self.message = message
        }
    }
    
    public class func openForReading(path: String, inout error: Error) -> IndexedFileV1? {
        let result = BinaryFile.openForReading(path)
        
        if let fileError = result.error {
