Fixes #237
Refs #229
Modified replacing