Correct behaviour for trailing slashes

fixes #2741
- Extend HistoryLocation
- Add trailing slash to path