Fix gsub issue

by replacing `gsub('__c','')` with `gsub(/__c$/,'')`