fix some bugs of EC
Merge pull request #763 from huili2/ec_bug_fix

fix some bugs of EC