fix most errors