Improved merge logic to avoid crash even if SRT is not well-formed