Fix bug in Router and Navigator