Manually serialize types