Add a start on the various tests.  Fix various errors.