Fixed checking through the use of hasOwnProperty