Lots of test code added.