Fix extension handling.