Fix issue with programname not being set properly