Resolving issues in __init__ and generate_annotations