Pr/12

Some changes to pull request #12 for compatibility with older Thrust version and with nvcc.