Original commit message from CVS: query and convert functions will remove debug output later when everything works