Annotation Tools: Fix delete bug and factor out code