Lot's of fixes
Removed some deprecated code
Uncommented new parts