Strip trailing slash. Closes #1579