Fix stripping of trailing slash