Handle trailing slash as optional.