small fixes to fix_angle function