Added destructor for MDState class and freeing memory when claling reset() in MDStateManager
Merged