Bugfix: check validity of ordered strings during hierarchy generation