Removed deprecated calls, better error reporting