Use TypeError in createProgram and createKernel