Added detection of file extensions