Fixed error parsing proxy settings.
Made imports comptible with python 3.