Added IE8-friendly for loops: no more for (var i in...)