Fixed calculation error in expectations