Fixed a bug with the program API, still might need tweaking