Fix checkArrayLength for the indexBuffer