Fix extensions with dot in filename being removed