Update and enhance tests.
Commit test file and improve tests some more.  Fix some bugs too!