fixed several bugs in annotation gathering