Run autopep8 on python scripts.

This was the command run on the two python script folders:  autopep8 -r --in-place --ignore="E501,E303"
I know that pep8 itself doesn't condone changes like these, but as I seem to be the only developer
of GAT, I hardly think it matters.
Fix errors introduced to "average" mode in 276bf4ef2e
Fix zero division error when only one key exists on a given curve.