Bug fix, test case passes.