Added cast support in Model.aggregate