Fix a bug in main.