patches for exceptions and urlparse import issues
Merge branch 'master' into stable

Merge in master for 1.2.1 release, fixes #50