self.pg needs to be set to None in the constructors for the objects. Fixes #1