Fixed some deprecated things and bugs