Fixed archiving and added in archive retrieval code