Added a few new test cases, and fixed some others.