Added hasOwnProperty check.