Fix character generation in main.py