Improved deserialization handling for non-generic types.