Check 'hasOwnProperty' when traversing object.