Remove unused instance variables.Fixes #2466For now it does not fix everything but it's a first step
Reintroduce needed variable.
New batch of inst var cleaning.