Fix bugs in the router, especially regarding Unregistering procedures