Test fixes

Fixes the tests currently broken on Jenkins. Also fixes the thrown exceptions that were printing stack traces to the console.