Fixed isNaN assertion