Support for Python 2.6+, 3.3+

this is to be tested for python 2. it fixes the issues in checks.py for python 3.