Fixing warnings/deprecation problems