Fixed pylint issues

Fixed most (not all) pylint issues.