Improve handling of NaN, update specs