Fix up header file which was lost on merge.
Don't remove items from an array while iterating over the array.