Fix a bug in handling partial results