Fixed compile error when Sha module isn't available
Make unit-tests exit with a non-zero status if any tests failed