Fix bug with replacement
Test replacement
Make removal more idiomatic; fix bug with replacement doc overwriting