Fixes trailing slash problem