Fixed trailing slash append code.