SAN FRANCISCO (MarketWatch) -- Crude-oil futures turned lower on Wednesday after a government report showed a surprise increase in oil inventories for the week ended July 16. Crude oil for September delivery lost 21 cents, or 0.3%, to $77.40 a barrel. The Energy Information Administration reported a rise of 400,000 barrels of oil for the week, while analysts polled by Platts had expected a decline of 1.6 million barrels and a trade group on Tuesday reported a decline of 241,000 barrels for the same week. Meanwhile, gasoline inventories rose 1.1 million barrels, the EIA said, and stockpiles of distillates, which include diesel and heating oil, rose 3.9 million barrels. The analysts surveyed by Platts had expected an increase of 1 million for gasoline stocks and 1.6 million for distillate stocks.