Fix small bugs in urllib import