Still, the company’s earnings came in ahead of expectations in a choppy environment.