Fix router bug on extension determination.