fix replace() inappropriately adding things to lists