Fix a huge bug in the router