added testcases. misc changes