Fix issue with out-of-order iteration of fields/methods