Fix bug where leaving a directoy with spaces would have an error