fix the calculation of the UNIFORM flag.
Logic has been revised compared to the previous implementation.