Add support for min and max in statistics