Automatically remove trailing slash when using autocomplete for directory names