Fix a problem when building up the hierarchy