Should fix AI crashes