FIX: 'self' is undefined in helper functions.

- d.debug should be used in 'run' function as opposed to 'self.debug'