misc tidies for logging and tests