Added extension detection.
Merge pull request #1 from lvictorino/master

Great work @lvictorino nice update.