An increase in inventory investment and a smaller trade deficit offset a hurricane-related slowdown in consumer spending and a decline in construction.