Add check for NaN, for when R's bessel function fails.