Fixes some bullshit in the save code with perks.
Merge remote-tracking branch 'upstream/master'