fix merge issues and few PEP8