Neither the min nor the max are casted to the correct type. This leads to type mismatch errors when the stats are compared.