router bug fixes and cleanup