Use hasOwnProperty when iterating over Array

This fixes the issue from issue #65. In the tests, I added a dummy property to `Array.prototype` so the issue shows up in the tests. I then added `hasOwnProperty` checks to two `for ... in` loops that loop over arrays, which fixes the issue.