Fixed handling of file extensions.