Fixed a bug in convert code
More fixes to convert