fix some bug detected by alltests

urllib, print, StringIO, import, basestring, etc.