improve ProgramTest exception handling