Fix problems with type conversion.