Boeing remains profitable, closes in on 787 fix