Fixes file extension detection.