Add exception_occurred and exception_clear tests