Remove not needed code and other fixes.