Fixed bugs and added tests for candidate extraction and annotation generation