Fix trailing slash issue