Fixing bug related with Array.sum in AD.ForwardG and AD.ForwardGH