Fix issue with out-of-order iteration of virtual methods