add CheckError and fix an potential error in LoadProgramSourceCode