Added basic support for aggregate functions