improved test for consensus, and some debug logging