Fixed archive and delete function.