fixed trailing slash issue, fixed broken unit tests. Closes #1273