Improve exception handling, less unchecked PrologExceptions