fixed path to tdtool command and some cleaning.