Added code to better handle floating IPs, pep8/pyflakes cleanup