Changed behaviour to ignore NaN and Infinity as per JSON spec