fix exception reporting in ktest ( fixes #485, #407 and probably others )