moved to using the boost filesystem library instead of trying to get the file extension myself, this should be much more robust