Accept @xtraeme's massive warning cleanup
Enhace @earada's patch to fix double free in 'dm' api