Added Rob's changes to getProgramPath.m

Added Rob's changes to getProgramPath.m - mainly to check for OS compatibility