Making sure 'end' replacement is case-sensitive