Should we perhaps be replacing all leading and trailing slashes instead of just the first?