Better handling of directory names