Corrected a bug when adding a new type