Added more complete unit tests.