Define self to prevent exception

For #6607. @dangoor