Fixed finding the right-most dot in file name.