Fix logic surrounding 'pending'.