Add better error message on failed close.