Fix some bugs with the conversion.