Fixed bug where directory names get truncated at last occurance of "."