Allegri: 'Milan shook off doubts'