Fixed #888: Problems when object has own 'hasOwnProperty' property

Fixes #888.