Add DEHEX tests, including tests for bug#1986