Fix bug in search-and-modify function

Now we can edit nodes again. Always good.

Change-Id: I4703d88febf62310a6e2deb6c79e84949558cc9e