fix maxValue bug in enumeration type + fix the return value validation bug