fixed a wrong index when retrieving features in clustering macros