BUG: fixed wrong index access for label statistics