Fixes to make the generate_routes script work properly.