Fix subdomain bug, flake8 cleanup