     
     public subscript(index: Index) -> Element {
         get {
-            if let element = elementAtIndex(index) {
-                return element
-            } else {
-                fatalError("Index out of bounds in OrderedDictionary.")
+            guard let element = elementAtIndex(index) else {
+                fatalError("OrderedDictionary index out of range")
             }
+            
+            return element
         }
         set(newValue) {
             updateElement(newValue, atIndex: index)

        guard orderedKeys.indices.contains(index) else { return nil }
        
        let key = orderedKeys[index]
        guard let value = self.keysToValues[key] else { fatalError("Inconsistency error occured in OrderedDictionary.") }
        
        return (key, value)
    }
    
    public mutating func updateElement(element: Element, atIndex index: Index) -> Element? {
        // TODO: Handle index out of range
        
        let currentElement = elementAtIndex(index)
        
        if currentElement != nil {
            keysToValues.removeValueForKey(element.0)
        }
        
        let (newKey, newValue) = (element.0, element.1)
        orderedKeys[index] = newKey

            guard nextIndex < lastIndex else { return nil }
            
            let nextKey = self.orderedKeys[nextIndex]
            
            guard let nextValue = self.keysToValues[nextKey] else {
                fatalError("Inconsistency error occured in OrderedDictionary")
            }
            
            let element = (nextKey, nextValue)
            
            nextIndex++
