Support objects and arrays in for loops
Tidying some stuff