Test program changes.
Fixed some broken tests.
Refactored unit tests.