Fixed bugs in annotaton tool