Bug 4461: Trivial bits from the rest of the patch, need to check status of open, otherwise bad things can happen.