Fix MinMax Bug