Fixed warnings for function max.