Titan type creation: improve safety

Right now there's no check on whether the types are already there and things like that.