Fixed a scoping bug.
Merge branch 'router-refactor' into dev