Updated d-t-m with bugfixes

Fixes #1035