Adding some error checking for joint test/index