Fixed iter's is_empty to use is_none() and added relevant test flag

Fixes #11785.