Support array return type. fixes #2

This is ad-hoc fix so need more better handling for aggregation types.