Small fixes, is_preferred should theoretically work, Flake8 fixes as well