Fix issue when exception are raised with embedded kb