Fixed bug in how styles are grouped to determine cyclic index