Error handling for Min and Max Aggregation