Fixing polarity calculation setup