fix exception reporting in ktest

Fixes #485