Remove some debug code
Fix depreacted warning