fix for issue #60 and #117

Checks whether or not the set method call will add a new item to a
nested array. If not, the ‘add’ event is not triggered where previously
it would.