fix some stuff discovered by PyCharm