Fix syntax error in compare method.