Ensure `make check` fails if tests fail and fix tests
Many of our test programs were still returning error-code 0 if they failed, causing the driver script to treat them as passing.
This MR fixes that, and fixes tests that were previously silently failing.
Edited by Jim Newsome