Fixed some exceptions when running on sublime text 3.

Fixed some exceptions when running on sublime text 3.