GEOS-5672: fixed nested group loop

Hi,
I've fixed issue GEOS-5672 on 2.3.x.