Added a lot of test cases.