Fixed file extension detection.