The company said the strong performance of its commercial aerospace business helped offset the problems.