Fixed bug in phase angle calculations.