More testing and refactoring.
More test case refactoring.
Test refactoring.