Changed the test from:
temp.indexOf( "Infinity" ) !== -1;

to:
temp.indexOf( "Infinity" ) !== -1  &&  temp.length === "Infinity".length;