Fix crash in is_empty