Fixed "for(i in lines)", checking for hasOwnProperty to avoid conflicts

I've added an `if ` to check if `for..in` is providing array values and not inherited values, like described [here](http://stackoverflow.com/a/4261096)