Improved checking config logic.