Fix import errors on Python 3