Fix Python 2 compatibility for GUI.

 * Minor changes that allows the GUI to be used in Python 2 as well as
   Python 3.