router fixes and test cases