Fix bug about looping over archiving commands.