Fix some errors and warnings when compiling with NVML libraries.