Fixed trailing slash issues

Trailing slash issues in case of a prefix root route were fixed. A path
ending with a trailing slash is now replaced by the same path without
trailing slash.