Added a NaN check until tomorrow.