fix replace-too-big behavior