Don't disable the comment module in your installation profile
Building a custom installation profile, I was suddenly getting a certain AJAX error during installation. After googling a bit, I came across this issue on drupal.org and it reminded me I did disable the core comment module. And altough there is no dependency in any of the other modules, there might be some kind of dependency in CTools? (installing ctools triggers some registry rebuilds, see this comment). In any case, the error dissapears when you include the comment module in your installation profile .info file.