checking for nulls and DOM nodes, which are not the kind of objects we want here