Fixing some minor issues (testing quantifiedcode.com)

I have been playing around with http://quantifiedcode.com/ and fixed some minor issues in the codebase.

Quantified Code is basically a collection of linters and code analysis tools. There are more issues found, but some of them are also invalid.

The tool's analysis of this branch can be seen here:

http://alpha.quantifiedcode.com/#/project/gh:bmorg:obspy?branch=origin/quantifiedcode