Fix null pointer for programs

programs was newed for 20 references but not 20 objects so programs[j]
was actually null when I was trying to use it.