Added a workaround for Python bug 13598