Fix trailing slash issue

Resolves #45 (I hope)