ITS#9339/ITS#9817/ITS#9907/ITS#9913 Some more memory related fixes

These follow up to the previous merge request, just got lost in a git stash.

Merge request reports

Loading