Fix issue with trailing slashes

Closes #9