Backported from trunk (rev #9960):
restore route type after running error route