Sovled some bugs in add-Test function.