String replacement fix