Better fix to generate_complement.py