Fixed bugs of routing refactoring.