'checktype' was modifed and debugged.