Fix extension detection