Fixed open() state in the case of open() failure.