Stop adding a trailing slash when replacing route data
Fixes T168