Fix a bug reported by EC