Modified the condition for maximum().