Fix an issue with union types in mongodb record conversion.