Fixed cloning logic for static routes to be able to capture closures