second pass to remove multiple stubs