Tidy list directory and trailing slash functions