minor changes and test code