Add conflicts checking mechanism. Some minor changes.