Move try-catch out from mutateNode

It doesn't really belong, and it's more consistent with similar
functions. Reverts 5fe27cb.