Fix scripts to comply with PEP8 1.5.0 (rebased onto develop)



This is the same as gh-72 but rebased onto develop.

----

This should fix the Travis build since PEP8 has been bumped to version 1.5.0

To test this PR, check the Travis build is green and no functionality is altered by the code changes.