Make deserialization more resilient to data being different types