Pylint fixes
Few were real bugs, others just needed a bit better code
Merge pull request #1328 from fstagni/pylintTS

Pylint fixes