Added better extension detection.
Build