Fix the errors in !39236 (merged) (the errors would emerge only in HepMC3 branch builds)
@wlampl @jchapman