Fix bugs in cj_Device.c. Tested on Accelerando.