Fix use if for...in to avoid problems with elements added to Array.prototype.  Resolves issue #667
Merge branch 'issue667' into develop.  Issue #667.