Fix OpenMP crashes