fixed some bugs encountered on the NVIDIA linux system