Adding some checkings in the constructors of some classes.