Fix #compiled_router not working well.
Improve the code. (@ujifgc's approach)
Merge pull request #1381 from namusyaka/fix-compiled_router

Fix #compiled_router not working well.