Merge Dan's changes with the Openmp trunk
Fix the remaining problems in merging cpp_standalone and openmp branches