Fix fatal when building extensions