Fixed the max function argument bug