Added support for cast on Model.aggregate