fix typo, added element check for isObject
updated tests