Fixed bug in polarization analysis