Fixed printing nan or inf values for polarization