logging
A number of test fixes and improvements