Changed aggregate syntax according to Mike Bayer's feedback