remove trailing slash from path, closes #286