Merge branch 'ma/reduce-heads-leakfix'