Python 3 compatibility adjustments.