Fix errors in angles computation