Include checks for NaN and Inf in the processing routines.