Several changes to handle the errors in case wrong configuration made