Correct output units
At the moment, output units are simply assigned as the units from the metadata. This worked, because for spell_length the units don't depend on the input. However, when in general the units need to be computed by the index_function, not the aggregator.