For arrays of aggregates, accessing a nonexistent value results in an error: a[2] <<< 2; @avg(a[3]) This is intentional, since @avg is considered undefined for a zero-element list. However, for scalars, we don't enforce this same thing: @avg(b) ; @max(b) may spit out a generic division-by-zero error or a sentinel "0" value. It should be made consistent with the vector-of-aggregates case, so that only @count() is valid on an empty aggregate scalar.
patched