On OSX needs to be changed as:
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
See http://stackoverflow.com/questions/7131858/stdtransform-and-toupper-no-matching-function