Updated delete logic to remove attributes when deleting types
Test improvements