Allegri: 'Milan survived the worst'