fixed recording replacement actions

- when a function node is replaced, the lines that are removed are
recorded in the action object.