Fix enumeration items access, make it more robust