Dropping the last comma, colon or semicolon when generating name index