Minor syntax changes to support Python 3