fix extend_cell_data() for several groups, new average_surface argument