fix errors and deprecation warnings