Aberdeen manager Derek McInnes praised his side's mentality after scraping into the third round of the Scottish League Cup against Alloa.