Fix memory not being written to the GPU properly; generating permutations now works