Fixed a github api issue and cleaned up the code a bit.