Fixed aggregation query (tested it thorougly on actual data)
Merge pull request #4 from martin-naumann/master

Fixed aggregation query (tested it thorougly on actual data)