Made some try/except blocks 3.x compatible.