Switch to TypeError in createProgram validation