Fix several bugs with the conversion helpers