[BUGFIX] Sync router.js, fix issue w recursive QP loop

Fixes #5037