some more defensive code for debugging low level issues on kiwi