Fixed num_components index error