Added test cases and exception.