Bug in object iteration