Bug fixes in source/server/router.js