anti-recursion.
finer is_empty_expanded check
Code cleanup and constistency: always use TYPE.is_empty_expanded instead of the lower-level TYPE_MARK.is_empty_expanded