Add hasOwnProperty to avoid conflicts with prototype extending libs

Add two missing hasOwnProperty on for in loops to avoid conflicts with prototype extending libs (for example Ember.js).