Fix for the "undefined" name issue, and a whole bunch of explicit 'this' references added to the GUI because I'm nuts that way.