added some error checking code to testIndices.py