Fixes to the way the program directory is found.