Fix a null array bug in archetype adding