Fixed for cases where node is being inserted or updated from a script rather than from the node form.