Fix trailing slash bug

Fixes #5