when cleaning shifts, check for infinity and NaN