Added test case fixed small errors