Closes #80, closes #79, and otherwise fixes "replace target"