Fix error in GrepProgram

Some variables were not necessarily set, causing errors