Add a test for CDataType and fix a bug that was calling freefunc too often.