Fixing comparison to max.