merged gpu module fixes from cuda-dev branch