MFH (r264691): merge upstream patch for EC calculation bug