Fix a couple places trying to access OpenFile too early.