fixes bug which made self reference available as a member of a class