Fix bug where separator was added to end of path