Use TypeError in createKernel and createProgram