     // Bounds check indicies
     guard pairs.map({$1.isInbounds($0)}).filter({$0 == false}).isEmpty else { return nil }
     
-    let shape = pairs.flatMap { (initialBound, index) -> Int? in
+    let shape = pairs.map { (initialBound, index) -> Int in
         switch index {
         case .All:
             return initialBound
         case .SingleValue:
-            return nil // Compress shape by removing extranious 1s
+            return 1
         case .List(let list):
             return list.count
         case .Range(let low, let high):

// Ugly functions get ugly names.
// The returned subarrays represent each possible combination of values from 0 to the bound for that place in the initial array.
private func enumerateAllValuesFromZeroToBounds(bounds: [Int]) -> [[Int]] {
    func recursivelyEnumerateAllValuesFromZeroToBounds(remainingBits: Swift.ArraySlice<Int>) -> [[Int]] {
        guard let first = remainingBits.first else { return [[]] }
        
        let results = recursivelyEnumerateAllValuesFromZeroToBounds(remainingBits.dropFirst())
        
        return (0..<first).map { currentIndex -> [[Int]] in
            return results.map { [currentIndex] + $0 }

            case .All:
                return g.next()!
            case .SingleValue(let sv):
                return sv + g.next()!
            case .Range(let low, _):
                return low + g.next()!
            case .List(let list):
