unit test fix and helpful logging