Correctly handle error on open.