Type checker: check identifier types and improved output print