More routing fixes

Rolling pull request for RC 4.
oh, neat! That'll come in handy for a few other projects as well.