Fixes some possible memory leaks.
Merge branch 'decomposition' into xtrmm