patches for exceptions and urlparse import issues