improving on the error check code
fixing a bug on DeterministicPrologQuery, before Prolog side exceptions were ignored.
small changes to keep the Java 8 compiler happy
keeping the Java8 compiler happy