Added test cases to cover all current test conditions.