Re-apply fix for the Router class

The fixes in pull request #2 have been reversed in the commit 48b3f7adcc6d4067e9853ee31a0466996e96dfcf.
This fixes the Router again.
Merge pull request #19 from lukasbestle/fixrouteragain

Re-apply fix for the Router class (reopens #2)