Add better debugging/error handling for all those issues, so it's easier to fix in the future #4937
Cosmetic
(ugly) Workaround for http://bugs.python.org/issue826897