style improvements and pep8

This might actually be a useful comment to keep, though I think it would be better to also write the BZ title or something explaining what it was in addition to this.