Improved the unit testing.