Made some changes to error handling, fixed ProgramLog
More changes