Update router.js - Fixes #1800