fixes to routing, added test