Fix trailing slash bug