Pr/12

Some changes for compatibility with older Thrust version and with nvcc.