Added validation of the configuration on the first run
Fixed bugs