Fix to angle calculation at all orientations