Minor fixes to be able to recover more easily from inconsistent states.
Version 1.0.6