Fixed "for(i in lines)", checking for hasOwnProperty to avoid conflicts with Object.prototype and Array.prototype extensions