[FIX] Reversing at Branch Nodes at End of Track

This fixes a few bugs when a train is at a
branch near the end of the track and we send it
a goto command.