Add getTypeId
Fix tests