Improved correctness of comparison value applied to maximum