Fix the failing test and add one more test to cover both when/otherwise conditions.