Fixed bugs in Router