Fixed int cast, improved test, switched to Idx/IdxStr