Fix an IE 8 issue caused by a for..in loop