Hunting down indexing issues in generateCPU.cc