Bugfixes from pylint