Some minor changes to support Gedit 3.8 (and Python 3)