Fix broken NaN test

Closes #794
Review 533 by @mlucy