fixed bugs with aggregated functions not correctly handling being passed arrays