Fix a bug in the test-complexity script and add more test cases.