Bug in archiving code