Port goal-direction patches from refactor