Fix OpenMP regression test failures

Patch provided by Alexey Bataev!