Added a check for empty state hierarchies.