Some more router cleanup and bug fixes.