Compile / bugfixes on MTD commandline tool