Changed property checking to Object.prototype.hasOwnProperty().