Some minor fixes, cleanup and added comments to wherever wasn't 100% pointless