Fix bug that caused dogs to move to wrong target.