ctrtool: tmd bug fix