Fix for class cast exceptions in HostArchiveWriter