Fix bug making trains with EGAM2 crash
Addresses a bug that causes trains including EGAM2 to crash as seen here:
https://bigpanda.cern.ch/job?pandaid=5661724159
The crash has been reproduced locally and with this fix I have been able to run a train with all 9 EGAM derivations successfully