Added new ctor. Added new testcases and genericized.