Fix bug that caused 'self' to be lost