Added more test cases and checks.