Applied TRD hotfix to online code.
Applied changes from !1752 (merged) to online code.
@apuntke could you please check whether this captures the essence of your hot fix? Please only look at the latest commit, as this is based off of !1759 (merged), which touches lots of files.
Row merging is not covered, as the online code currently does not support it.
Assigned to @a.bercuci. Reviewer should be @apuntke but GitLab doesn't allow it.
Perhaps of interest to @p.-a.loizeau