critical fixes: extras on failed request, don't leak routers.

code cleanup, various other minor bugfixes.