Fixed bug in route cleanup