Fixes to issues identified by Coverity.

Ah, then we should (1) verify that the nvcc problem persists and (2) if this is the case add an annotation in a comment that explains the reason.