Adding some protection for empty containers (needed for the trigger since we don't always decode the full detector) and adding initialisation of the output container. Fixes crashes reported in ATR-20656 and ATR-20661.