Bug fixes in consistency checking