Fixed a bug for enumeration