Fix an important bug  where using the remote island model with CUDA produced segfaults