fixed up tests and logging