Fixed bug with router

Fixes #403