Fix countIndex