Fix logic in is_empty().