Fixed a bug in the conversion