Sync router.js, closes #3242