fixes to tdl-apply and tdl-config