Fixes memory leaks in libMMD