Adding more test cases and custom exception types