Minor changes and test code clean up.