Add support for Infinity and NaN values