Remove extension, if exists

related: #2441