Fix deprecated use of nan() method.