This PR fixes some lint complaints regarding exact type comparisons. It seems flake8 6.1.0 is more discerning than 6.0.0, which is probably for the best.