Fix a few potential memory leaks.
Merge pull request #1546 from ktf/fix-MVATrainer-leaks

AT fixes -- Fix a few potential memory leaks.