Fixes ULTRA arithmetic error, and also prints exception stack traces to both stdout and stderr.