Fixed bug in enumeration process