Routing based on PATH_INFO, fix some minor bugs