Should some of these hasOwnProperty checks inside for-in loops be early continue instead of wrapping in a conditional? Now it is quite easy to still run some code after the conditional but still inside the for in loop, perhaps unintentionally? But I don't know those few places in this diff so well.