Refine benchmark tests
Fix a bug in optimization
Improve generated test case numbers