Fix bug in item processing.