It took me a long time to realize that integers do not have NaN. This edit would have saved me a lot of time.