Fixes to angle calculations.