Minor compilation fixes and setting the number of threads for openmp