Added validation to constructors