correcting many bugs in the converter package, adding some tests