Fix extensions behavior when file already has extension