more bug fixes

more local bug fixes in danutil
more bug fixes in dpat