Check index length.