fixed various problems with reading annotation file