Fixed Sed replacement bug