minor bug safe file
better msgs
rigorous consistency check