Correction of code to avoid of usage of undefined associated parameters in order not to get exception in constructor. Creation of test case for this issue