           else
             return if info.record.measures[info.metric.id] == v
             saveRun info.cell, info.record.measureSet(info.metric.id, v).then (rec) ->
-              rcm = Data[info.c || 0][info.metric.id]
+              rcm = Data[rec.category || 0][info.metric.id]
               for i, n of Depends[info.d]
                 arr(rcm, n)[i] = v
                 # TODO age may have changed... not clear how to update.

        # Fill Cols and Groups from records
        populateCols = ->
          Cols = []
          $scope.groups = Groups = Object.keys(Data).sort(byNumber).map (c) ->
            category = getCategory(c)
            if Editing
              for m in category.template
                arr(Data[c], m)
            metrics = Object.keys(Data[c]).map(maybeInt)
                    .sort(byType)
            metrics.pop() # remove 'id' (necessarily last)
            metrics = _.map metrics, getMetric
            # add back the 'id' column first if needed
            if !metrics.length
              metrics.unshift(pseudoMetric.id)
            si = Cols.length
            Cols.push.apply Cols, _.map metrics, (m) ->
              category: category
              metric: m
              sortable: m != pseudoMetric.id || metrics.length == 1
            l = metrics.length
            Cols[si].first = Cols[si+l-1].last = l
            {

          slot:
            id: 'slot'
            name: if Top then 'materials' else 'session'
            template: if Top then ['$name'] else ['$name', 'date', 'release']
            sort: -10000
          0:
            id: 0
            name: 'record'
