add missing imports, further comments, remove one empty type, fix types of Analysis fields