more fixes PEP8 and upstream merge