Fix using addtrap in tests.