Added compat module to fix some issues on Python 3+