Clean up warnings and deprecation issues