Fix archive un/pack logic