Improve debugging code and remove some old syntax from tests.