Python 3 compatibility. Tests update.