fix return value of CloseArchive, and add logging.