Feature/fix matrixlist

These fixes the problems with structure_plif_hmsvm_bmrm, but valgrind still gets angry with structure_discrete_hmsvm_bmrm.